cmake_minimum_required(VERSION 3.11)
set(PROJECT_NAME1 "main")
set(CMAKE_BUILD_TYPE "Release")
#set(CMAKE_C_STANDARD 99)
set(PROJ_DIR "/home/qingdu/Test/Form/form_add0")
set(Eigen3_DIR "/usr/include/eigen3")
#set(CMAKE_PREFIX_PATH "/usr/local/include/eigen3")
#set(CMAKE_CXX_STANDARD_REQUIRED True)  #解释是说可以提升代码的可执行率，但感觉没有啥用
#设置自己的项目文件夹目录，用以定位文件夹下的include'和lib

project(${PROJECT_NAME1})
find_package(OpenCV REQUIRED)
find_package(Eigen3 REQUIRED)
#find_package(Threads REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
message(STATUS "OpenCV library status:")
message(STATUS "    config: ${OpenCV_DIR}")
message(STATUS "    version: ${OpenCV_VERSION}")
message(STATUS "    libraries: ${OpenCV_LIBS}")
message(STATUS "    include path: ${OpenCV_INCLUDE_DIRS}")

include_directories(${Eigen3_INCLUDE_DIRS})
message(STATUS "Eigen3 library status:")
message(STATUS "    config: ${Eigen3_DIR}")
message(STATUS "    version: ${Eigen3_VERSION}")
message(STATUS "    libraries: ${Eigen3_LIBS}")
message(STATUS "    include path: ${Eigen3_INCLUDE_DIRS}")

link_directories("${PROJ_DIR}/lib/64")
include_directories("${PROJ_DIR}/include" "/usr/include/X11" "/usr/include" "${PROJ_DIR}/src")
include_directories(/usr/include/eigen3)    #changed path: need to be configured
link_libraries("${PROJ_DIR}/lib/64/libMvCameraControl.so")
add_compile_options(-std=c++11)
add_executable(${PROJECT_NAME1} main.cpp)
add_library(camera_class SHARED src/camera_class.cpp)
add_library(ArmorPlate SHARED src/ArmorPlate.cpp)
add_library(Serial SHARED src/Serial.cpp)
add_library(SolveAngle SHARED src/solveangle.cpp)

# Link your application with OpenCV libraries
target_link_libraries(${PROJECT_NAME1} ${OpenCV_LIBS} )
target_link_libraries(${PROJECT_NAME1}  -lX11)
target_link_libraries(${PROJECT_NAME1} libMvCameraControl.so)
target_link_libraries(${PROJECT_NAME1} camera_class)
target_link_libraries(${PROJECT_NAME1} ArmorPlate)
target_link_libraries(${PROJECT_NAME1} SolveAngle)
target_link_libraries(${PROJECT_NAME1} pthread)
target_link_libraries(SolveAngle Eigen3::Eigen)
target_link_libraries(${PROJECT_NAME1} Serial)


